package com.java.base.thread;

public class ThreadLocalTest {

    static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public static void main(String[] args) throws InterruptedException {
        Thread t = test();
        System.out.println(t.isAlive());
        System.out.println();
    }

    public static Thread test() {
        Thread t1  = new Thread(() -> {
            threadLocal.set(Thread.currentThread().getName());
            System.out.println(threadLocal.get());
        });
        t1.start();
        return t1;
    }

}
